package com.feimaopian.service;

import com.feimaopian.entity.User;
import com.feimaopian.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User findById(String user_id) {
        return userMapper.findById(user_id);
    }

    @Override
    public Boolean eq(String user_id, String pwd) {
        User user = userMapper.findById(user_id);
        if (user == null) {
            return false;
        }
        return user.getPwd().equals(pwd);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

}
